Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change baud rate to 250k, which an 8Mhz pro micro can support. #10

Closed
wants to merge 1 commit into from
Closed

Change baud rate to 250k, which an 8Mhz pro micro can support. #10

wants to merge 1 commit into from

Conversation

datagrok
Copy link

I recently built a Mitosis keyboard, but I used a 8Mhz pro micro instead of the 16Mhz one by mistake.

If I understood the datasheet correctly, when running at 8Mhz the pro micro can't achieve 1M baudrate.

I was able to make it work with no apparent loss in functionality by changing the baud rate to 250k.

Since this seems to be adequate, it could be set this way by default and enable either flavor of pro micro board to be compatible with the receiver module firmware.

A corresponding change is also needed in the qmk firmware, in keyboards/mitosis/config.h:

-#define SERIAL_UART_BAUD 1000000
+#define SERIAL_UART_BAUD 250000

Corresponding changes will be needed in the wireless firmware.
jackhumbert pushed a commit to qmk/qmk_firmware that referenced this pull request Nov 3, 2017
* mitosis/datagrok: reduce features from rules.mk

* mitosis/datagrok: make both layer keys neighbor shift

* mitosis/datagrok: (no-op) tweak some comments

* mitosis/datagrok: set baudrate to 250k

This requires a corresponding change to the mitosis wireless firmware:
reversebias/mitosis#10

* mitosis/datagrok: move design description from code comment to a readme

* mitosis/datagrok: new layout, new shifted keys, efficient LED code

This is experimental, but compiles and seems to work correctly.

* mitosis/datagrok: whoops, move readme.md

* mitosis/datagrok: a minor layout improvement simplifies custom-shifted code

instead of [, .] [? !], using [, ?] [. !] greatly simplifies the code
needed to perform the shifted-key switching. (And keeps , and . on the
same keys that they are under qwerty.)

also: layout improvements for symbols

* mitosis/datagrok: make my code conform to QMK style guidelines

* mitosis/datagrok: TODO note for layout table in README

* mitosis/datagrok: remove led_set_user until i figure out other changes

need to see if the corresponding changes needed in the keyboard-level code
is okay.

* mitosis/datagrok: simpler layer indicator

* mitosis/datagrok: undo change to keyboard baud; make it in my layout dir.

* mitosis/datagrok: apply same punctuation hack to qwerty layer

* mitosis/datagrok: enable qwerty layer toggle

* mitosis/datagrok: update readme
@reversebias
Copy link
Owner

Hmm.. Might need to get the scope back out and test this one. I distinctly remember there being a reason for selecting the highest baud rate when I wrote it. Something to do with the polling time and buffers, IIRC. Did you just do a basic functionality test?

@datagrok
Copy link
Author

datagrok commented Nov 6, 2017

Yes, just basic use of the keyboard. Also I'm an electronics novice and I don't own an oscilloscope so this was informed guesswork at best.

If you do find a problem I'd love it if you could describe it in more detail when you close this issue, so I can learn from the mistake. Thanks for the great project! 😄

kgwong pushed a commit to kgwong/qmk_firmware that referenced this pull request Nov 26, 2017
* mitosis/datagrok: reduce features from rules.mk

* mitosis/datagrok: make both layer keys neighbor shift

* mitosis/datagrok: (no-op) tweak some comments

* mitosis/datagrok: set baudrate to 250k

This requires a corresponding change to the mitosis wireless firmware:
reversebias/mitosis#10

* mitosis/datagrok: move design description from code comment to a readme

* mitosis/datagrok: new layout, new shifted keys, efficient LED code

This is experimental, but compiles and seems to work correctly.

* mitosis/datagrok: whoops, move readme.md

* mitosis/datagrok: a minor layout improvement simplifies custom-shifted code

instead of [, .] [? !], using [, ?] [. !] greatly simplifies the code
needed to perform the shifted-key switching. (And keeps , and . on the
same keys that they are under qwerty.)

also: layout improvements for symbols

* mitosis/datagrok: make my code conform to QMK style guidelines

* mitosis/datagrok: TODO note for layout table in README

* mitosis/datagrok: remove led_set_user until i figure out other changes

need to see if the corresponding changes needed in the keyboard-level code
is okay.

* mitosis/datagrok: simpler layer indicator

* mitosis/datagrok: undo change to keyboard baud; make it in my layout dir.

* mitosis/datagrok: apply same punctuation hack to qwerty layer

* mitosis/datagrok: enable qwerty layer toggle

* mitosis/datagrok: update readme
LovesTha pushed a commit to LovesTha/qmk_firmware that referenced this pull request Jul 24, 2018
* mitosis/datagrok: reduce features from rules.mk

* mitosis/datagrok: make both layer keys neighbor shift

* mitosis/datagrok: (no-op) tweak some comments

* mitosis/datagrok: set baudrate to 250k

This requires a corresponding change to the mitosis wireless firmware:
reversebias/mitosis#10

* mitosis/datagrok: move design description from code comment to a readme

* mitosis/datagrok: new layout, new shifted keys, efficient LED code

This is experimental, but compiles and seems to work correctly.

* mitosis/datagrok: whoops, move readme.md

* mitosis/datagrok: a minor layout improvement simplifies custom-shifted code

instead of [, .] [? !], using [, ?] [. !] greatly simplifies the code
needed to perform the shifted-key switching. (And keeps , and . on the
same keys that they are under qwerty.)

also: layout improvements for symbols

* mitosis/datagrok: make my code conform to QMK style guidelines

* mitosis/datagrok: TODO note for layout table in README

* mitosis/datagrok: remove led_set_user until i figure out other changes

need to see if the corresponding changes needed in the keyboard-level code
is okay.

* mitosis/datagrok: simpler layer indicator

* mitosis/datagrok: undo change to keyboard baud; make it in my layout dir.

* mitosis/datagrok: apply same punctuation hack to qwerty layer

* mitosis/datagrok: enable qwerty layer toggle

* mitosis/datagrok: update readme
@joric
Copy link
Contributor

joric commented Sep 2, 2019

I upvote this. I've just managed to run receiver on a custom board with 3.3v promicro without regulators and level shifters and it was awesome. My project: https://github.com/joric/jorian

QMK Patch:

diff --git a/keyboards/mitosis/config.h b/keyboards/mitosis/config.h
index f2220278e..7abeae5bb 100644
--- a/keyboards/mitosis/config.h
+++ b/keyboards/mitosis/config.h
@@ -60,20 +60,20 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //#define NO_ACTION_FUNCTION
 
 //UART settings for communication with the RF microcontroller
-#define SERIAL_UART_BAUD 1000000
+#define SERIAL_UART_BAUD 250000
 #define SERIAL_UART_DATA UDR1

Mitosis receiver patch:

diff --git a/mitosis-receiver-basic/main.c b/mitosis-receiver-basic/main.c
index 5739d13..50df903 100644
--- a/mitosis-receiver-basic/main.c
+++ b/mitosis-receiver-basic/main.c
@@ -14,8 +14,20 @@
 #define UART_RX_BUF_SIZE 1                           /**< UART RX buffer size. */
 
 
+// I am using BlueMicro daughter board with 3.3V Pro Micro on top
+// See https://github.com/jpconstantineau/NRF52-Board/tree/master/YJ-14015
+// Picture: https://i.imgur.com/Ed3KmLV.jpg
+// CTS/RTS pins are never really used anywhere
+
+#define USE_BLUEMICRO
+#ifdef USE_BLUEMICRO 
+#define RX_PIN_NUMBER  14 //promicro TX0
+#define TX_PIN_NUMBER  13 //promicro RX1
+#else
 #define RX_PIN_NUMBER  25
 #define TX_PIN_NUMBER  24
+#endif
+
 #define CTS_PIN_NUMBER 23
 #define RTS_PIN_NUMBER 22
 #define HWFC           false
@@ -75,7 +87,7 @@ int main(void)
           CTS_PIN_NUMBER,
           APP_UART_FLOW_CONTROL_DISABLED,
           false,
-          UART_BAUDRATE_BAUDRATE_Baud1M
+          UART_BAUDRATE_BAUDRATE_Baud250000
       };
 
     APP_UART_FIFO_INIT(&comm_params,

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants